package com.jwdf.uda.http.action;

import android.content.Context;

import com.jwdf.uda.bean.PbBean;
import com.jwdf.uda.http.AHttpService;
import com.jwdf.uda.http.ApiService;

import retrofit2.Call;

/**
 * 类说明：
 * 作者：huangqiuxin on 2016/5/14 14:27
 * 邮箱：648859026@qq.com
 */
public class GuideAddEvaluationAction extends AHttpService<PbBean.PbResGuideAddEvaluation>{
    /**
     *  搭配指导添加评价
     * @param context
     * @param id 指导ID
     * @param evaluation 评价
     * @return
     */
    public static GuideAddEvaluationAction newInstance(Context context, int id, PbBean.PbSignGuideEvaluation evaluation){
        return new GuideAddEvaluationAction(context, id, evaluation);
    }
    private int id;
    private PbBean.PbSignGuideEvaluation evaluation;
    private GuideAddEvaluationAction(Context context, int id, PbBean.PbSignGuideEvaluation evaluation) {
        super(context);
        this.id = id;
        this.evaluation = evaluation;
    }

    @Override
    protected Call newRetrofitCall(ApiService apiService, PbBean.PbBaseClientInfo.Builder baseBuilder) {
        PbBean.PbReqGuideAddEvaluation.Builder builder = PbBean.PbReqGuideAddEvaluation.newBuilder();
        builder.setBaseClientInfo(baseBuilder);
        builder.setId(id);
        builder.setEvaluation(evaluation);

        return apiService.guideAddEvaluation(builder.build());
    }
}
